package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 食谱表
 * @TableName recipe
 */
@TableName(value ="recipe")
@Data
public class Recipe {
    /**
     * 
     */
    @TableId(value = "recipe_id", type = IdType.AUTO)
    private Integer recipeId;

    /**
     * 食谱名称
     */
    @TableField(value = "recipe_name")
    private String recipeName;

    /**
     * 膳食类型ID
     */
    @TableField(value = "type_id")
    private Integer typeId;

    /**
     * 烹饪方法
     */
    @TableField(value = "cooking_method")
    private String cookingMethod;

    /**
     * 食材清单
     */
    @TableField(value = "ingredients")
    private String ingredients;

    /**
     * 烹饪步骤
     */
    @TableField(value = "cooking_steps")
    private String cookingSteps;

    /**
     * 总卡路里
     */
    @TableField(value = "calorie")
    private BigDecimal calorie;

    /**
     * 总蛋白质
     */
    @TableField(value = "protein")
    private BigDecimal protein;

    /**
     * 总脂肪
     */
    @TableField(value = "fat")
    private BigDecimal fat;

    /**
     * 总碳水化合物
     */
    @TableField(value = "carbohydrate")
    private BigDecimal carbohydrate;

    /**
     * 适合人群
     */
    @TableField(value = "suitable_crowd")
    private String suitableCrowd;

    /**
     * 创建人ID
     */
    @TableField(value = "creator_id")
    private Integer creatorId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Recipe other = (Recipe) that;
        return (this.getRecipeId() == null ? other.getRecipeId() == null : this.getRecipeId().equals(other.getRecipeId()))
            && (this.getRecipeName() == null ? other.getRecipeName() == null : this.getRecipeName().equals(other.getRecipeName()))
            && (this.getTypeId() == null ? other.getTypeId() == null : this.getTypeId().equals(other.getTypeId()))
            && (this.getCookingMethod() == null ? other.getCookingMethod() == null : this.getCookingMethod().equals(other.getCookingMethod()))
            && (this.getIngredients() == null ? other.getIngredients() == null : this.getIngredients().equals(other.getIngredients()))
            && (this.getCookingSteps() == null ? other.getCookingSteps() == null : this.getCookingSteps().equals(other.getCookingSteps()))
            && (this.getCalorie() == null ? other.getCalorie() == null : this.getCalorie().equals(other.getCalorie()))
            && (this.getProtein() == null ? other.getProtein() == null : this.getProtein().equals(other.getProtein()))
            && (this.getFat() == null ? other.getFat() == null : this.getFat().equals(other.getFat()))
            && (this.getCarbohydrate() == null ? other.getCarbohydrate() == null : this.getCarbohydrate().equals(other.getCarbohydrate()))
            && (this.getSuitableCrowd() == null ? other.getSuitableCrowd() == null : this.getSuitableCrowd().equals(other.getSuitableCrowd()))
            && (this.getCreatorId() == null ? other.getCreatorId() == null : this.getCreatorId().equals(other.getCreatorId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRecipeId() == null) ? 0 : getRecipeId().hashCode());
        result = prime * result + ((getRecipeName() == null) ? 0 : getRecipeName().hashCode());
        result = prime * result + ((getTypeId() == null) ? 0 : getTypeId().hashCode());
        result = prime * result + ((getCookingMethod() == null) ? 0 : getCookingMethod().hashCode());
        result = prime * result + ((getIngredients() == null) ? 0 : getIngredients().hashCode());
        result = prime * result + ((getCookingSteps() == null) ? 0 : getCookingSteps().hashCode());
        result = prime * result + ((getCalorie() == null) ? 0 : getCalorie().hashCode());
        result = prime * result + ((getProtein() == null) ? 0 : getProtein().hashCode());
        result = prime * result + ((getFat() == null) ? 0 : getFat().hashCode());
        result = prime * result + ((getCarbohydrate() == null) ? 0 : getCarbohydrate().hashCode());
        result = prime * result + ((getSuitableCrowd() == null) ? 0 : getSuitableCrowd().hashCode());
        result = prime * result + ((getCreatorId() == null) ? 0 : getCreatorId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", recipeId=").append(recipeId);
        sb.append(", recipeName=").append(recipeName);
        sb.append(", typeId=").append(typeId);
        sb.append(", cookingMethod=").append(cookingMethod);
        sb.append(", ingredients=").append(ingredients);
        sb.append(", cookingSteps=").append(cookingSteps);
        sb.append(", calorie=").append(calorie);
        sb.append(", protein=").append(protein);
        sb.append(", fat=").append(fat);
        sb.append(", carbohydrate=").append(carbohydrate);
        sb.append(", suitableCrowd=").append(suitableCrowd);
        sb.append(", creatorId=").append(creatorId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}